//
//  CMAnswerProCell.m
//  CreditManger
//
//  Created by sky on 15/11/9.
//  Copyright © 2015年 jinxin. All rights reserved.
//

#import "CMAnswerProCell.h"

@implementation CMAnswerProCell


- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        [self buildLayout];
    }
    return self;
}


-(void)buildLayout{
    UILabel *prompt = [self LabelWithRect:CGRectMake(10, 15, SCREEN_WIDTH - 20, 180/2 - 15) textColor:[LCCommon getColor:@"999999"] textstr:@"为了确保是您本人查询个人信用信息,需要您真实准确的回答以下问题;其准确性会影响到是否能成功获取信用记录。" textfont:14 textstyle:NSTextAlignmentLeft];
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:prompt.text];
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setLineSpacing:7];//调整行间距
    [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [prompt.text length])];
    prompt.attributedText = attributedString;
    [prompt sizeToFit];
    [self.contentView addSubview:prompt];
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


-(UILabel *)LabelWithRect:(CGRect)rect textColor:(UIColor *)color textstr:(NSString *)str textfont:(int)font textstyle:(NSTextAlignment)aligment{
    UILabel *label = [[UILabel alloc] initWithFrame:rect];
    label.textColor = color;
    label.text = str;
    label.font = [UIFont systemFontOfSize:font];
    label.textAlignment = aligment;
    label.numberOfLines = 0;
    return label;
}



@end
